project(fe_st)

if (BUILD_OPEN_PROJECT)
    SET(FE_ROOT_PATH ${AIR_CODE_DIR}/compiler/graphcompiler/engines/nneng)
else()
    SET(FE_ROOT_PATH ${TOP_DIR}/air/compiler/graphcompiler/engines/nneng)
    SET(METADEF_DIR ${TOP_DIR}/metadef)
endif()

file(GLOB_RECURSE PROTO_LIST RELATIVE ${CMAKE_CURRENT_LIST_DIR}
        "${METADEF_DIR}/proto/task.proto"
        "${METADEF_DIR}/proto/ge_ir.proto"
        "${METADEF_DIR}/proto/om.proto"
        "${METADEF_DIR}/proto/insert_op.proto")

protobuf_generate(fe_st PROTO_SRCS PROTO_HDRS ${PROTO_LIST})

# compile for fe_st
add_executable(fe_st
        ${PROTO_HDRS}
        ${CMAKE_CURRENT_LIST_DIR}/testcase/main.cc
        ${FE_ROOT_PATH}/optimizer/adapter/common/get_attr_by_type.cc
        ${FE_ROOT_PATH}/optimizer/adapter/common/op_store_adapter_manager.cc
        ${FE_ROOT_PATH}/optimizer/adapter/tbe_adapter/tbe_op_store_adapter.cc
        ${FE_ROOT_PATH}/optimizer/adapter/tbe_adapter/tbe_info/tbe_info_assembler.cc
        ${FE_ROOT_PATH}/optimizer/adapter/tbe_adapter/tbe_info/tbe_single_op_info_assembler.cc
        ${FE_ROOT_PATH}/optimizer/common/format/axis_name_util.cc
        ${FE_ROOT_PATH}/optimizer/common/format/axis_util.cc
        ${FE_ROOT_PATH}/optimizer/common/format/range_axis_util.cc
        ${FE_ROOT_PATH}/optimizer/common/fusion_statistic/buffer_fusion_info_collecter.cc
        ${FE_ROOT_PATH}/optimizer/common/fusion_statistic/fusion_statistic_writer.cc
        ${FE_ROOT_PATH}/optimizer/common/graph/fe_graph_utils.cc
        ${FE_ROOT_PATH}/optimizer/common/util/json_util.cc
        ${FE_ROOT_PATH}/optimizer/common/dump_util.cc
        ${FE_ROOT_PATH}/optimizer/common/fe_utils.cc
        ${FE_ROOT_PATH}/optimizer/common/fusion_op_comm.cc
        ${FE_ROOT_PATH}/optimizer/common/math_util.cc
        ${FE_ROOT_PATH}/optimizer/common/op_info_common.cc
        ${FE_ROOT_PATH}/optimizer/common/pass_manager.cc
        ${FE_ROOT_PATH}/optimizer/common/plugin_manager.cc
        ${FE_ROOT_PATH}/optimizer/common/unknown_shape_util.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/format_dtype_op_builtin_selector.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/broadcast/format_process/broadcast_format_process.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/broadcast/format_process/broadcast_process_5hd.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/broadcast/format_process/broadcast_process_6d.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/broadcast/format_process/broadcast_process_6hd.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/broadcast/format_process/broadcast_process_fractal_z.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/broadcast/format_process/broadcast_process_nz.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/broadcast/format_process/broadcast_process_fractal_z_3d.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/process/format_process_registry.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/reduce/reduce_format_selector/reduce_format_process.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/reduce/reduce_format_selector/reduce_process_5hd.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/reduce/reduce_format_selector/reduce_process_6hd.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/reduce/reduce_format_selector/reduce_process_fractal_z.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/builtin/reduce/reduce_format_selector/reduce_process_nz.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/common/format_dtype_selector_base.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/manager/format_dtype_manager_base.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/manager/format_dtype_querier.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/manager/format_dtype_setter.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/op_customize/format_dtype_op_customize_selector.cc
        ${FE_ROOT_PATH}/optimizer/format_selector/op_kernel/format_dtype_op_kernel_selector.cc
        ${FE_ROOT_PATH}/optimizer/fusion_config_manager/fusion_config_parser.cc
        ${FE_ROOT_PATH}/optimizer/fusion_config_manager/fusion_priority_manager.cc
        ${FE_ROOT_PATH}/optimizer/fusion_manager/fusion_manager.cc
        ${FE_ROOT_PATH}/optimizer/fusion_rule_manager/fusion_rule_data/fusion_rule_pattern.cc
        ${FE_ROOT_PATH}/optimizer/fusion_rule_manager/fusion_rule_parser/attr_assignment_expression.cc
        ${FE_ROOT_PATH}/optimizer/fusion_rule_manager/fusion_rule_parser/fusion_rule_json_pattern.cc
        ${FE_ROOT_PATH}/optimizer/fusion_rule_manager/fusion_rule_parser/fusion_rule_node_constructor.cc
        ${FE_ROOT_PATH}/optimizer/fusion_rule_manager/fusion_rule_parser/fusion_rule_parser_utils.cc
        ${FE_ROOT_PATH}/optimizer/fusion_rule_manager/fusion_rule_parser/fusion_rule_pattern_constructor.cc
        ${FE_ROOT_PATH}/optimizer/fusion_rule_manager/fusion_rule_manager.cc
        ${FE_ROOT_PATH}/optimizer/itf_handler/itf_handler.cc
        ${FE_ROOT_PATH}/optimizer/ops_kernel_store/fe_ops_kernel_info_store.cc
        ${FE_ROOT_PATH}/optimizer/ops_kernel_store/sub_ops_store.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/fusion_common/fusion_pass_manager.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/fusion_common/graph_node_map_util.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/graph_fusion.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/graph_matcher.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/graph_replace.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/conv_weight_compress_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/psroipooling_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/stride_hoist_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/swap_merge_cast_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/concat_quant_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/node_optimize/conv_concat_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/node_optimize/node_optimize_pass_base.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/node_optimize/split_conv_concat_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/node_optimize/checker/concat_optimize_checker.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/node_optimize/checker/node_optimize_checker_base.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/node_optimize/checker/split_optimize_checker.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/node_optimize/common/node_optimize_utils.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/node_optimize/common/node_optimize_utils.h
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/quant_host_cpu_op_common.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/tf_merge_conv2dbackpropinput_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/tf_merge_sub_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/tf_tag_no_const_folding_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/avgpool_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/bias_optimize_quant_rollback_base.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/conv2d_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/conv2dtd_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/deconvolution_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/dwconv2d_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/fc_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/group_conv2d_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/matmulv2_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/batch_matmulv2_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/pooling_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/bias_optimize_quant_rollback/maxpool_quant_process_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/requant_fusion_pass/v100_not_requant_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/requant_fusion_pass/v100_requant_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/requant_fusion_pass/v100_requant_util.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/requant_fusion_pass/v200_not_requant_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/requant_fusion_pass/v200_requant_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/graph_fusion/fusion_pass_manager/builtin_pass/quant_pass/requant_fusion_pass/v200_requant_util.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/heavy_format_propagation/heavy_format_propagation.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/heavy_format_propagation/heavy_format_selector.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/heavy_format_propagation/heavy_format_supportformats_updater.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/node_optimizer/concat_n_optimizer.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/node_optimizer/split_n_optimizer.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_axis_update/op_axis_update_desc.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_compiler/op_compiler.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_compiler/op_compiler_baseline.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_compiler/op_compiler_mstune_before_ub_match.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_compiler/op_compiler_normal.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_compiler/op_compiler_optune.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_compiler/tbe_json_parse.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/dtype_strategy/op_dtype_selection_strategy_allow_fp32_to_fp16.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/dtype_strategy/op_dtype_selection_strategy_allow_mix_precision.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/dtype_strategy/op_dtype_selection_strategy_base.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/dtype_strategy/op_dtype_selection_strategy_default_mode.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/dtype_strategy/op_dtype_selection_strategy_force_fp16.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/dtype_strategy/op_dtype_selection_strategy_force_fp32.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/format_strategy/op_format_selection_strategy_default_mode.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/format_strategy/op_format_selection_strategy_follow_predecessor.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/matcher/dtype/op_dtype_matcher_base.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/matcher/dtype/op_dtype_mix_precision_matcher.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/matcher/dtype/op_dtype_precise_matcher.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/matcher/dtype/op_dtype_reduce_matcher.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/matcher/dtype/op_dtype_rise_matcher.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/matcher/format/op_format_matcher.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/strategy/op_format_dtype_strategy_manager.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/update_desc/subgraph/sub_data_format_dtype_update.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/update_desc/subgraph/sub_graph_format_dtype_update.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/update_desc/subgraph/sub_netoutput_format_dtype_update.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/update_desc/op_format_dtype_update_desc.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/update_desc/op_format_dtype_update_desc_base.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/format_and_dtype/op_format_dtype_judge.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/imply_type/op_impl_type_judge.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_judge/op_judge_base.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/op_setter/op_setter.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/range_format_transfer/transfer_range_according_to_format.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_implementation/trans_node_base_generator.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_implementation/trans_node_cast_generator.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_implementation/trans_node_reformat_generator.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_implementation/trans_node_reshape_generator.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_implementation/trans_node_transdata_generator.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_implementation/trans_node_transpose_generator.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_manager/trans_node_insertion/trans_node_insertion.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_manager/trans_node_merging/trans_node_merging.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/trans_node_manager/trans_node_manager.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/shape_format_transfer/transfer_shape_according_to_format.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/spacesize_calculator/spacesize_calculator.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/spacesize_calculator/tensor_compute_util.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/stream_graph_optimizer/l2_optimizer/l2_fusion_allocation/l2_fusion_allocation.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/stream_graph_optimizer/l2_optimizer/l2_fusion_comm/l2_fusion_comm.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/stream_graph_optimizer/l2_optimizer/l2_fusion_handler/l2_fusion_handler.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/stream_graph_optimizer/l2_optimizer/l2_fusion_parser/l2_fusion_parser.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/stream_graph_optimizer/l2_optimizer/l2_fusion_rtl2ctrl/l2_fusion_rtl2ctrl.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/stream_graph_optimizer/l2_optimizer/l2_optimizer.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_bnupdate_eltwise_eltwise_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_bnupdate_eltwise_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_common_rules0_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_common_rules2_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_conv2d_backprop_elemwise_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_conv_bnreduce_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_conv_dequant_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_conv_dequant_quant_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_conv_requant_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_depthwiseconv_dequant_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_depthwiseconv_elemwise_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_eltwise_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_eltwise_quant_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_eltwise_write_select_fussion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_multi_output_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_read_select_eltwise_fussion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_reduce_elemwise_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_segment_elemwise_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/aipp_conv_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/conv_dequant_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/conv_dequants16_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/conv_eltwise_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/conv_pooling_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/conv_requant_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/conv_requants16_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/conv_select_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/conv_strided_slice_info.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/ub_pass_slice_info_base.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/ub_pass_slice_info/ub_pass_slice_info_manager.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_dynamic_elemwise_reduce_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/tbe_pass/tbe_dynamic_elemwise_broadcast_fusion_pass.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/automatic_buffer_fusion.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/buffer_fusion.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/buffer_fusion_pass_runner.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/reachability_map.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/fusion_graph_merge/fusion_graph_merge.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/fusion_graph_merge/ub_fusion_graph_merge.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/ub_fusion/fusion_graph_merge/l1_fusion_graph_merge.cc
        ${FE_ROOT_PATH}/optimizer/graph_optimizer/fe_graph_optimizer.cc
        ${FE_ROOT_PATH}/opskernel/ops_store/op_kernel_info.cc
        ${FE_ROOT_PATH}/opskernel/ops_store/op_kernel_info_constructor.cc
        ${FE_ROOT_PATH}/opskernel/ops_store/ops_kernel_manager.cc
        ${FE_ROOT_PATH}/opskernel/ops_store/ops_kernel_utils.cc
        ${FE_ROOT_PATH}/opskernel/ops_store/sub_op_info_store.cc
        ${FE_ROOT_PATH}/utils/adapter/adapter_itf/task_builder_adapter.cc
        ${FE_ROOT_PATH}/utils/adapter/factory/task_builder_adapter_factory.cc
        ${FE_ROOT_PATH}/utils/adapter/tbe_adapter/kernel_launch/l2_cache_kernel_launch.cc
        ${FE_ROOT_PATH}/utils/adapter/tbe_adapter/kernel_launch/tbe_kernel_launch.cc
        ${FE_ROOT_PATH}/utils/adapter/tbe_adapter/tbe_task_builder_adapter.cc
        ${FE_ROOT_PATH}/utils/common/common_utils.cc
        ${FE_ROOT_PATH}/utils/common/configuration.cc
        ${FE_ROOT_PATH}/utils/common/fe_type_utils.cc
        ${FE_ROOT_PATH}/utils/common/graph_comm.cc
        ${FE_ROOT_PATH}/utils/common/graph_comm_impl.cc
        ${FE_ROOT_PATH}/utils/common/l2_stream_info.cc
        ${FE_ROOT_PATH}/utils/common/lxfusion_json_util.cc
        ${FE_ROOT_PATH}/utils/common/op_slice_info.cc
        ${FE_ROOT_PATH}/utils/common/op_tensor_utils.cc
        ${FE_ROOT_PATH}/utils/common/scope_allocator.cc
        ${FE_ROOT_PATH}/utils/common/taskdown_common.cc
        ${FE_ROOT_PATH}/utils/common/function_state.cc
        ${FE_ROOT_PATH}/utils/common/attr_list.cc
        ${FE_ROOT_PATH}/utils/ops_kernel_builder/aicore_ops_kernel_builder.cc
        ${FE_ROOT_PATH}/utils/param_calculate/tensorsize_calculator.cc
        ${FE_ROOT_PATH}/utils/task_builder/task_builder.cc
        ${CMAKE_CURRENT_LIST_DIR}/../graph_constructor/graph_builder_utils.cc
        ${CMAKE_CURRENT_LIST_DIR}/../graph_constructor/graph_constructor.cc
        ${CMAKE_CURRENT_LIST_DIR}/../stub/slog_stub.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/format_selector/format_dtype_selector_manager_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/fusion_manager/st_configuration.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/fusion_manager/st_graph_comm.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/fusion_manager/st_itf.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/fusion_manager/st_op_info_common.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/fusion_manager/st_tensor_compute_util.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/fusion_rule_manager/fusion_rule_manager_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/fusion_config_manager/fusion_config_parser_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/node_optimize/checker/concat_optimize_checker_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/node_optimize/conv_concat_fusion_pass_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/node_optimize/split_conv_concat_fusion_pass_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_bnhost_fusion_pass_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_batchnorm_bninfer_fusion_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_derelu_fusion_pass_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_logsoftmaxgrad_fusion_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_matmul_biasadd_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_matmul_cast_fusion_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_psroipooling_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_concat_quant_fusion_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_requant_fusion_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_tf_merge_conv2dbackpropinput_fusion_pass_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_engine_tf_quant_fusion_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_pass_conv_weight_compress_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_quant_norequant_eltwise_pass_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_quant_process_conv2dtd_pass_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/fusion_quant_rollback_bias_optimize_pass_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/pass_fusion_manager/graph_fusion_stride_hoist_pass_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/fusion_engine_graph_replace_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/graph_fusion/graph_matcher_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/heavy_format_propagation/st_heavy_format_propagation.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/heavy_format_propagation/st_heavy_format_propagation_complex.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/op_calculator/st_op_calculator.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/op_judge/stest_op_judge_new.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/op_setter/op_setter_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/op_setter/op_slice_info_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/trans_op_insert/trans_op_insert_complex_by_original_format_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/trans_op_insert/trans_op_insert_complex_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/trans_op_insert/trans_op_insert_complex_stest_2.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/trans_op_insert/trans_op_insert_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/update_axis/op_axis_update_desc_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/fusion_engine_fe_graph_optimizer_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/graph_optimizer/fusion_engine_l2_optimzer_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/op_compiler/fusion_engine_op_compiler_unittest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/op_compiler/fusion_engine_tbe_json_parser_unittest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ops_kernel_store/check_attr_support_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ops_kernel_store/check_param_type_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ops_kernel_store/json_util_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ops_kernel_store/op_info_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ops_kernel_store/ops_kernel_info_store_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ops_kernel_store/ops_kernel_info_store_stest_2.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/task_builder/task_builder_stest.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/fusion_stub.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/network_topology_ub_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/scopeallocator_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_bnupdate_elemwise_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_common_rules2_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_conv2d_backprop_eltwise_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_conv_dequant_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_conv_dequant_quant_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_conv_eltwise_relu_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_conv_requant_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_conv_stride_quant_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_conv_strided_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_depthwiseconv_dequant_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_depthwiseconv_elemwise_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_l1_fusion_st.cc
        ${CMAKE_CURRENT_LIST_DIR}/testcase/ub_fusion/tbe_ub_fusion_st.cc)

if (BUILD_OPEN_PROJECT)
    target_include_directories(fe_st PRIVATE
            ${CMAKE_CURRENT_LIST_DIR}
            ${TOP_DIR}/air/test/engines/nneng
            ${FE_ROOT_PATH}/inc
            ${FE_ROOT_PATH}/optimizer
            ${FE_ROOT_PATH}/utils
            ${FE_ROOT_PATH}/opskernel
            ${METADEF_DIR}/inc/common/opskernel
            ${METADEF_DIR}/inc/common/optimizer
            ${METADEF_DIR}/inc/common/util
            ${METADEF_DIR}/inc/common
            ${METADEF_DIR}/inc/register
            ${METADEF_DIR}/inc/external
            ${METADEF_DIR}/inc/external/graph
            ${METADEF_DIR}/inc
            ${METADEF_DIR}/inc/graph/utils
            ${METADEF_DIR}/inc/graph/
            ${METADEF_DIR}/third_party
            ${AIR_ROOT_INC_DIR}/external
            ${AIR_ROOT_INC_DIR}/framework
            ${AIR_ROOT_INC_DIR}/ops
            ${AIR_ROOT_INC_DIR}
            ${GTEST_INCLUDE}
            ${TOP_DIR}/ops/built-in/op_proto/inc
            ${TOP_DIR}/cann/ops/built-in/op_proto/inc
            ${TOP_DIR}/asl/ops/ops/built-in/op_proto/inc
            ${TOP_DIR}/asl/ops/cann/ops/built-in/op_proto/inc
            ${AIR_CODE_DIR}/test/engines/nneng/graph_constructor
            ${CMAKE_BINARY_DIR}/proto/fe_st)

    target_compile_options(fe_st PRIVATE
            $<$<COMPILE_LANGUAGE:CXX>:-std=c++11>
            -D__OPTIMIZER_KT_TEST__
            -DDAVINCI_CLOUD
            -Dgoogle=ascend_private)

    target_link_libraries(fe_st PRIVATE
            $<BUILD_INTERFACE:intf_pub>
            -Wl,--no-as-needed
            -lrt -ldl -lpthread -lgcov
            graph
            register
            runtime_stub_fe
            ascend_protobuf
            c_sec
            platform
            compress
            error_manager
            json
            gtest
            gtest_main
            c_sec_static)
else()
    target_include_directories(fe_st PRIVATE
            ${CMAKE_CURRENT_LIST_DIR}
            ${TOP_DIR}/air/test/engines/nneng
            ${FE_ROOT_PATH}/inc
            ${FE_ROOT_PATH}/optimizer
            ${FE_ROOT_PATH}/utils
            ${FE_ROOT_PATH}/opskernel
            ${METADEF_DIR}/inc/common/opskernel
            ${METADEF_DIR}/inc/common/optimizer
            ${METADEF_DIR}/inc/common/util
            ${METADEF_DIR}/inc/common
            ${METADEF_DIR}/inc/register
            ${METADEF_DIR}/inc/external
            ${METADEF_DIR}/inc/external/graph
            ${METADEF_DIR}/inc
            ${METADEF_DIR}/inc/graph/utils
            ${METADEF_DIR}/inc/graph/
            ${TOP_DIR}/inc/external
            ${TOP_DIR}/inc/framework
            ${TOP_DIR}/inc/ops
            ${TOP_DIR}/inc
            ${TOP_DIR}/graphengine/inc/framework
            ${TOP_DIR}/graphengine/inc/external
            ${TOP_DIR}/graphengine/inc
            ${TOP_DIR}/ops/built-in/op_proto/inc
            ${TOP_DIR}/cann/ops/built-in/op_proto/inc
            ${TOP_DIR}/asl/ops/ops/built-in/op_proto/inc
            ${TOP_DIR}/asl/ops/cann/ops/built-in/op_proto/inc
            ${TOP_DIR}/air/test/engines/nneng/graph_constructor
            ${CMAKE_BINARY_DIR}/proto/fe_st)

    target_compile_options(fe_st PRIVATE
            $<$<COMPILE_LANGUAGE:CXX>:-std=c++11>
            -D__OPTIMIZER_KT_TEST__
            -DDAVINCI_CLOUD
            -Dgoogle=ascend_private)

    target_link_libraries(fe_st PRIVATE
            $<BUILD_INTERFACE:intf_llt_pub>
            -Wl,--no-as-needed
            -lrt -ldl -lpthread -lgcov
            graph
            register
            runtime_stub_fe
            ascend_protobuf
            c_sec
            platform
            compress
            error_manager
            json
            c_sec_static)

    run_llt_test(
            TARGET fe_st
            TASK_NUM 1)
endif()
